home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / zbpc_460.zip / GRAPHICS.EXE / SHOWTYME.BAS < prev    next >
BASIC Source File  |  1991-03-20  |  2KB  |  84 lines

  1. ' SHOWTYME
  2. ' by James Ducasse
  3. ' (modified for speed by Andrew Gariepy)
  4. :
  5. ' This is an excellent example of using the high-speed
  6. ' USR 8 and USR 9 Integer SINE and COSINE functions
  7. ' built into all versions of the ZBasic compiler
  8. :
  9. SELECT CARDTYPE
  10.   CASE 0 ' CGA card
  11.     MODE 5
  12.     Colormax = 4
  13.   CASE 1 ' EGA card
  14.     MODE 17
  15.     Colormax = 16
  16.   CASE 2 ' EGA card w/monochrome monitor
  17.     MODE 18
  18.     Colormax = 1
  19.   CASE 3 ' Hercules card
  20.     MODE 20
  21.     Colormax = 1
  22.   CASE 4 ' VGA card
  23.     MODE 22
  24.     Colormax = 16
  25.   CASE 5 ' VGA card /monochrome monitor
  26.     MODE 21
  27.     Colormax = 1
  28.   CASE 6 ' MCGA card
  29.     MODE 23
  30.     Colormax = 256
  31.   CASE 7 ' MCGA card w/monochrome monitor
  32.     MODE 23
  33.     Colormax = 256
  34.   CASE ELSE ' Either MPDA or not recognized!
  35.     MODE 2
  36.     Colormax = 1
  37. END SELECT
  38. CLS : RANDOMIZE
  39. :
  40. CR% = 7
  41. V1 = 4
  42. :
  43. DO
  44.   LONG IF Colormax = 1
  45.     C1 = 1 : C2 = 1 : C3 = 1
  46.   XELSE
  47.     C1 = RND(Colormax-1) : C2 = RND(Colormax-1) : C3 = RND(Colormax-1)
  48.   END IF
  49.   COLOR = C1, C2, C3 : PRINT @(0,0) "Color ="; C1,C2,C3
  50.   FOR R = 0 TO 256
  51.     A% = USR 9 (Q * R) / 4
  52.     X1 = (USR 9 (R) * A%) / 50 + 512
  53.     Y1 = (USR 8 (R) * A%) / 50 + 384
  54.     B = R + E
  55.     B2% = USR 9 (V1 * B) / 4
  56.     X2 = (USR 9 (B) * B2%) / 50 + 512
  57.     Y2 = (USR 8 (B) * B2%) / 50 + 384
  58.     PLOT X1, Y1 TO X2, Y2
  59.     I$ = INKEY$
  60.     IF LEN(I$) THEN "END"
  61.   NEXT R
  62.   Q = RND(12)
  63.   IF Q = 7 THEN Q = 0
  64.   IF Q = 1 AND V1 = 0 THEN V1 = RND(12)
  65.   E = RND(200)
  66.   V1 = RND(12)
  67.   IF V1 = 7 THEN V1 = 0
  68.   IF V1 > 6 THEN V1 = V1 - 12
  69.   IF Q < 1 AND V1 = 1 THEN V1 = RND(50)
  70.   IF Q = 1 AND V1 = 1 THEN V1 = RND(100)
  71.   CR% = RND(17)
  72.   IF CR% = 2 THEN CR% = 4
  73.   IF CR% = 3 THEN CR% = 6
  74.   IF CR% > 6 AND C4% < 10 THEN CR% = CR% + 4
  75.   CR1% = CR% + 1
  76.   DELAY 2000
  77.   CLS
  78. UNTIL LOOP ' LOOP = 0 so this is a never-ending loop
  79. :
  80. "END"
  81. MODE 2
  82. CLS
  83. END
  84.